<template>
    <el-button @click="showMsgbox">click</el-button>
</template>

<script>
import { getCurrentInstance, reactive, toRefs, h } from 'vue';
import MsgBox from './msgbox';

export default {
    setup () {
        const { ctx } = getCurrentInstance();
        const state = reactive({
            name: 'zs',
        });
        const showMsgbox = () => {
            ctx.$msgbox({
                customClass: 'msgbox',
                showClose: true,
                title: 'msgbox',
                center: true,
                showConfirmButton: false,
                message: h(MsgBox, { ...state, taskId: 123, key: Date.now() }),
            }).catch(() => {});
        };
        return {
            ...toRefs(state), showMsgbox,
        };
    },
};
</script>

<style>

</style>
